using System;

namespace noug.tdd {
    public class AddNewUserController {
        private IUserValidator _userValdidator;
        private IUserRepository _userRepository;
        public void Create(string name, string email, string address) {
            var u = new User() { Name = name, Email = email, Address = address };
            if (_userValdidator.IsValid(u))
                _userRepository.Save(u);
        }
        public AddNewUserController(IUserRepository userRepository, IUserValidator userValdidator) {
            _userRepository = userRepository;
            _userValdidator = userValdidator;
        }
    }
}
